<template>
  <el-table :data="props.tableData" style="width: 100%; height: 100%">
    <el-table-column
      v-for="item in column"
      :key="item.prop"
      :prop="item.prop"
      :label="item.label.split('_').at(-1)"
    >
    </el-table-column>
  </el-table>
</template>

<script setup>
import { watch } from "vue";

const props = defineProps({
  tableData: Array,
  column: Array,
});

let column = ref([]);
watch(
  () => props.column,
  (newval) => {
    if(!newval) return;
    newval.map((item) => {
      column.value.push({
        prop: item.props || item.code,
        label: item.label || item.name,

      });
    });
  },
  {
    immediate: true,
    deep: true,
  }
);
</script>

<style>
</style>